package org.jxkj.dto;

import org.jxkj.utils.StringUtils;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * PMU高频数据
 */
public class PmuPointDataDTO {

    /**
     * 测点编号
     */
    private String pointCode;

    /**
     * 数据（毫秒级）
     */
    Map<Long, Double> data;

    public PmuPointDataDTO(long startTime, long endTime) {
        long cap = (endTime - startTime) / 20 + 5;
        data = new LinkedHashMap<>(Integer.parseInt(StringUtils.valueOf(cap)));
    }

    public String getPointCode() {
        return pointCode;
    }

    public void setPointCode(String pointCode) {
        this.pointCode = pointCode;
    }

    public Map<Long, Double> getData() {
        return data;
    }

    public void addData(Long ts, Double value) {
        data.put(ts, value);
    }
}
